package Entity;

import java.io.Serializable;
import java.util.*;

import javax.persistence.*;

@Entity
@Table (name = "Sucursales")
public class SucursalesEntity implements Serializable{

	private static final long serialVersionUID = 1L;

	@Id
	@Column (name = "idSucursal", nullable = false)
	private int idSucursal;
	
	@Column (name = "nombre", length = 100)
	private String nombre;
	
	@Column (name = "ubicacion", length = 100)
	private String ubicacion;
	
	@Column (name = "capacidad")
	private int capacidad;
	
	@OneToMany
	@JoinColumn (name = "idSucursal") 
	private List<CajaEntity> caja = new ArrayList<CajaEntity>();
	
	@OneToMany
	@JoinColumn (name = "idSucursal")
	private List<CartaEntity> carta = new ArrayList<CartaEntity>();
	
	@ManyToMany 
	@JoinTable (name = "AreaSucursal", joinColumns = {@JoinColumn (name = "idSucursal")}, inverseJoinColumns = { @JoinColumn(name = "idArea") })
	private List<AreaEntity> areas = new ArrayList<AreaEntity>();
	
	@OneToMany
	@JoinColumn (name = "idSucursal")
	private List<TareaEntity> tareas = new ArrayList<TareaEntity>();
	
	@OneToMany
	@JoinColumn (name = "idSucursal")
	private List<ReservaEntity> reservas = new ArrayList<ReservaEntity>();
}
